//
//  Utils.h
//  YRSideViewController
//
//  Created by ZachChen on 14-8-31.
//  Copyright (c) 2014年 YueRuo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIkit.h>

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#define SCREEN_SIZE_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_SIZE_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

#define LocationUpdated @"LocationUpdated"
#define CACHEDATANOTIFACION @"cacheData"

#define RemoteNOTIFACION @"remotenotifaction"
#define kPushType @"type"
#define kNewLikesCnt @"FAVOUR"
#define kNewCommentsCnt @"COMMENT"
#define kNewFollowsCnt @"FOLLOWER"

#define IMLoginSuccess @"IMLoginSuccess"
#define LikedUpdateNOTIFACION @"LikedUpdateNOTIFACION"
#define kThirdparthLoginRes @"kThirdparthLoginRes"

#define ItemSetSelected @"ItemSetSelected"
#define AddressSetSelected @"AddressSetSelected"
#define EnterEditModel @"EnterEditModel"
#define PayResuldShow @"PayResuldShow"
#define AddShoppingCart @"AddShoppingCart"
#define BuketNumberChange @"BuketNumberChange"

#define DESKey @"GEGEJIE2015"

#if defined(DEBUG)||defined(_DEBUG)
//#define RCService_ID @"KEFU144600322687575"
#define RCService_ID @"KEFU1442902668322"
#else
#define RCService_ID @"KEFU1442902668322"
#endif


#define QGDEFAULTS [NSUserDefaults standardUserDefaults]
#define ShareApplicationDelegate [[UIApplication sharedApplication] delegate]


@interface Utils : NSObject
{

}
+(void) TTAlert:(NSString*) message;
+(void) TTAlertNoTitle:(NSString*) message;
+(BOOL) Dictionary:(NSDictionary*)dic ContainsNormalKey:(NSString*)key;
+(BOOL) Dictionary:(NSDictionary*)dic ContainsArrayKey:(NSString*)key;
+(BOOL) Dictionary:(NSDictionary*)dic ContainsDicKey:(NSString*)key;
+(NSString*) StringValueForDict:(NSDictionary*)dict ForKey:(NSString*)Key;
+(NSString*) FormatNSDate:(NSDate*) Date;
+(NSDate*) NSStringToData2:(NSString*) strDate;
+ (UIImage *)fixOrientation:(UIImage *)aImage;
+ (UIImage *)getSubImage:(UIImage*) image withRect:(CGRect)rect;
+ (UIImage *)cutHeadImage:(UIImage*) image Rd:(int)degree;

+(int) phoneFontL1;
+(int) phoneFontL2;
+(int) phoneFontL3;
+(int) phoneFontL4;
+(int) phoneFontL5;
+(int) phoneFontL6;
+(int) phoneFontL7;

+(int) phoneHeadWidth;
+(int) phoneHeadHeight;
+(float) phoneHeightRate;
+(float) phoneMinHeightfix;
+(float) phoneWidthRatio;
+(void) UMReport:(NSString*)key withValue:(int)value;

+ (NSString *)textFromBase64String:(NSString *)base64;
+ (NSString *)base64StringFromText:(NSString *)text;
+ (NSData *)DESDecrypt:(NSData *)data WithKey:(NSString *)key;
+ (NSData *)DESEncrypt:(NSData *)data WithKey:(NSString *)key;
+ (NSString *)base64EncodedStringFrom:(NSData *)data;
+ (NSData *)dataWithBase64EncodedString:(NSString *)string;
+(UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize;
+ (NSString *)HXChatterToUMDBUser:(NSString *)hxChatter;
+ (NSString *)UIDToHXChatter:(int)UID;
+ (NSDictionary*) JsonParse:(NSString*) JsonData;

+(UIButton*) NavButtonStyleNormalBLeft:(BOOL)bLeft NormalImg:(NSString*)Image AndHightLight:(NSString*) ImageH;

@end
